using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Features
{
    /// <summary>
    /// <para>Feature To Polygon</para>
    /// <para>Creates a feature class containing polygons generated from areas enclosed by input line or polygon features.</para>
    /// <para>创建一个要素类，其中包含从输入线或面要素所包围的区域生成的面。</para>
    /// </summary>    
    [DisplayName("Feature To Polygon")]
    public class FeatureToPolygon : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FeatureToPolygon()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input features, which can be line, polygon, or both.</para>
        /// <para>输入要素，可以是直线、面或两者。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class.</para>
        /// <para>输出面要素类。</para>
        /// </param>
        public FeatureToPolygon(List<object> _in_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Feature To Polygon";

        public override string CallName => "management.FeatureToPolygon";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _cluster_tolerance, _attributes.GetGPValue(), _label_features];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input features, which can be line, polygon, or both.</para>
        /// <para>输入要素，可以是直线、面或两者。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class.</para>
        /// <para>输出面要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>XY Tolerance</para>
        /// <para><xdoc>
        ///   <para>The minimum distance separating all feature coordinates, and the distance a coordinate can move in X, Y, or both during spatial computation. The default XY tolerance is set to 0.001 meter or its equivalent in feature units.</para>
        ///   <para>Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在空间计算过程中，分隔所有要素坐标的最小距离以及坐标可以在 X、Y 或两者中移动的距离。缺省 XY 容差设置为 0.001 米或以特征单位表示的等效容差。</para>
        ///   <para>更改此参数的值可能会导致失败或意外结果。建议不要修改该参数。它已从工具对话框的视图中删除。默认情况下，将使用输入要素类的空间参考 x，y 容差属性。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("XY Tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _cluster_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Preserve attributes</para>
        /// <para>This parameter is no longer supported.</para>
        /// <para>不再支持此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Preserve attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _attributes_value _attributes { get; set; } = _attributes_value._true;

        public enum _attributes_value
        {
            /// <summary>
            /// <para>ATTRIBUTES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ATTRIBUTES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_ATTRIBUTES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_ATTRIBUTES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Label Features</para>
        /// <para>The optional input point features that contain the attributes to be transferred to the output polygon features.</para>
        /// <para>包含要传输到输出面要素的属性的可选输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Label Features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _label_features { get; set; } = null;


        public FeatureToPolygon SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}